﻿@using Microsoft.AspNetCore.Mvc.Localization
@using MicroService.ApiGateway.Bundling
@using MicroService.ApiGateway.Ocelot.Dto
@using MicroService.ApiGatewayAdmin.Domain.Localization.ApiGateway;
@inject IHtmlLocalizer<ApiGatewayResource> Localizer
@model GlobalConfigurationDto
@section styles {
    <abp-style-bundle name="@WebServiceBundles.Styles.OcelotGlobal"></abp-style-bundle>
}
@section scripts{
    <abp-script-bundle name="@WebServiceBundles.Scripts.OcelotGlobal"></abp-script-bundle>
}
<form class="layui-form layui-form-pane" action="" lay-filter="GlobalCfg">
    @Html.Hidden("ItemId")

    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>@Localizer["Basic"]</legend>
        <hr class="layui-bg-blue">
    </fieldset>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label ocelot-line">@Localizer["BaseUrl"]</label>
            <div class="layui-input-inline ocelot-line-input">
                <input type="text" autocomplete="off" lay-verify="required" name="BaseUrl" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label ocelot-line">@Localizer["RequestIdKey"]</label>
            <div class="layui-input-inline  ocelot-line-input">
                <input type="text" autocomplete="off" name="RequestIdKey" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label ocelot-line">@Localizer["DownstreamScheme"]</label>
            <div class="layui-input-inline ocelot-line-input">
                <input type="text" name="DownstreamScheme" id="DownstreamScheme" autocomplete="off" class="layui-input">
            </div>
        </div>
    </div>
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>@Localizer["Qos"]</legend>
        <hr class="layui-bg-blue">
    </fieldset>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label ocelot-line">@Localizer["Basic"]</label>
            <div class="layui-input-inline ocelot-line-input">
                <input type="text" autocomplete="off" name="ExceptionsAllowedBeforeBreaking" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label ocelot-line">@Localizer["DurationOfBreak"]</label>
            <div class="layui-input-inline  ocelot-line-input">
                <input type="text" autocomplete="off" name="DurationOfBreak" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label ocelot-line">@Localizer["TimeoutValue"]</label>
            <div class="layui-input-inline  ocelot-line-input">
                <input type="text" autocomplete="off" name="TimeoutValue" class="layui-input">
            </div>
        </div>
    </div>
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>@Localizer["RateLimit"]</legend>
        <hr class="layui-bg-blue">
    </fieldset>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label ocelot-line">@Localizer["ClientIdHeader"]</label>
            <div class="layui-input-inline ocelot-line-input">
                <input type="text" autocomplete="off" name="ClientIdHeader" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label ocelot-line">@Localizer["QuotaExceededMessage"]</label>
            <div class="layui-input-inline  ocelot-line-input">
                <input type="text" autocomplete="off" name="QuotaExceededMessage" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label ocelot-line">@Localizer["HttpStatusCode"]</label>
            <div class="layui-input-inline ocelot-line-input">
                <input type="text" autocomplete="off" name="HttpStatusCode" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <div class="layui-input-inline  ocelot-line-input">
                <input type="checkbox" name="DisableRateLimitHeaders" title="@Localizer["DisableRateLimitHeaders"]">
            </div>
        </div>
    </div>
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>@Localizer["HttpHandler"]</legend>
        <hr class="layui-bg-blue">
    </fieldset>
    <div class="layui-form-item">
        <label class="layui-form-label ocelot-line">@Localizer["OtherOptions"]</label>
        <div class="layui-input-block">
            <input type="checkbox" name="AllowAutoRedirect" title="@Localizer["AllowAutoRedirect"]">
            <input type="checkbox" name="UseCookieContainer" title="@Localizer["UseCookieContainer"]">
            <input type="checkbox" name="UseProxy" title="@Localizer["UseProxy"]">
            <input type="checkbox" name="UseTracing" title="@Localizer["UseTracing"]">
        </div>
    </div>
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>@Localizer["LoadBalancer"]</legend>
        <hr class="layui-bg-blue">
    </fieldset>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label ocelot-line">@Localizer["LoadWay"]</label>
            <div class="layui-input-inline  ocelot-line-input">
                <select name="Type">
                    <option value="LeastConnection">@Localizer["LeastConnection"]</option>
                    <option value="RoundRobin">@Localizer["RoundRobin"]</option>
                    <option value="NoLoadBalance">@Localizer["NoLoadBalance"]</option>
                </select>
            </div>
        </div>
    </div>
    <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
        <legend>@Localizer["ServiceDiscovery"]</legend>
        <hr class="layui-bg-blue">
    </fieldset>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label ocelot-line">@Localizer["DiscoveryType"]</label>
            <div class="layui-input-inline  ocelot-line-input">
                <select name="ServiceType">
                    <option value="">@Localizer["None"]</option>
                    <option value="Consul">Consul</option>
                    <option value="Zookeeper">Zookeeper</option>
                    <option value="Eureka">Eureka</option>
                </select>
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label ocelot-line">@Localizer["Host"]</label>
            <div class="layui-input-inline ocelot-line-input">
                <input type="text" autocomplete="off" name="Host" class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label ocelot-line">@Localizer["Port"]</label>
            <div class="layui-input-inline  ocelot-line-input">
                <input type="text" autocomplete="off" name="Port" class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item layui-layout-admin">
        <div class="layui-input-block">
            <div class="layui-footer ocelot-footer" style="left: 0; text-align: center">
                <button class="layui-btn" lay-submit="" lay-filter="btnSave">@Localizer["Submit"]</button>
            </div>
        </div>
    </div>

</form>
